#pragma once
/*
@description: Contra entity contains state and behavior
@author: TriLVH
*/

#include "ContraData.h"
#include "ContraState.h"
#include "ContraPhysics.h"
#include "AbstractEntity.h"

class ContraEntity : public AbstractEntity {
	
private:
	// ContraData, init data when create contra entity
	ContraData *_data;
	ContraState *_state;
	ContraPhysics *_physics;
public:
	ContraEntity(int, double x, double y);
	
	// Get contra data, only for factory entity, not use to edit contra data
	ContraData* getData();
	AbstractData* getAbstractData();
	// Contra draw and update
	void draw(long time);
	void update(long time);
	void initData();
	void updateData(int type, int action);

	// Contra state behavior
	// Contra stand state
	void stand();
	void standUp();
	// Contra move state
	void moveRight();
	void moveLeft();
	// Contra fire state
	void fire(bool onHold);
	void fireSit();
	bool checkDelayShooting();
	void resetTimeDelayShooting();
	// Contra sit
	void sit();
	// Contra fly
	void fly(bool onHold);
};